Repository navigation
Support installing with SvelteKit 3 - #64
Merged
Merged
Conversation
…g there - Optional peer @sveltejs/kit: ^2.12.0 || ^3.0.0. With ^2.12.0, npm refused to install 0.15.0 next to SvelteKit 3 (ERESOLVE). - SvelteKit 3 no longer sets is_in_universal_load, so convexLoadHydration still embeds nothing there (fail closed). Its warning now says that SvelteKit 3 isn't supported yet instead of asking for 2.56+.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Name the effect (universal loads re-run in the browser before auth), the fix (move auth-dependent convexLoad calls to +page.server.ts / +layout.server.ts, same code; remove the handle) and the docs link.
mmailaender
marked this pull request as ready for review
October 13, 2026 07:27
Collaborator
Author
|
@mikecann have send you a message on discord which would be great if you could read it first 😊 |
mikecann
approved these changes
Oct 14, 2026
mikecann
left a comment
Member
There was a problem hiding this comment.
Thanks Micha, looks good. One small thing my agent spotted tho: runed is still in dependencies but nothing imports it any more, and its peer range (@sveltejs/kit ^2.21.0) still gives an ERESOLVE warning on SvelteKit 3 and fails with --strict-peer-deps. Might be worth dropping it before you merge?
commit: |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
convex-svelte0.15.0 with SvelteKit 3. The new optional peer@sveltejs/kit: ^2.12.0excluded it, and npm treats that asERESOLVE. The peer range is now^2.12.0 || ^3.0.0.convexLoadHydrationgets an accurate warning on SvelteKit 3. The behavior is unchanged: it embeds nothing there, fail closed.ERESOLVE.@mmailaender/convex-better-auth-svelte, which usesinitConvex(), the transport andconvexLoadin universal and server loads, passes all 28 e2e tests against 0.15.0.Before / after (user code)
Why
Install. The optional
@sveltejs/kitpeer was added in 0.15.0 for$app/state, which needs 2.12 or later. SvelteKit 3 came out at the same time, and npm rejects mismatched optional peers that are installed. pnpm only warns, so this went unnoticed.convexLoadHydration. It needs to know whetherconvexLoadruns in a universal load. SvelteKit 2.56+ exposes that asis_in_universal_loadin its request store. In SvelteKit 3:runtime/server/page/load_data.js).query()(is_in_remote_query) instead of checking for universal loads.So the handle can't tell the two kinds of load apart, and correctly embeds nothing. But its warning asked for "SvelteKit 2.56 or later", which is misleading on SvelteKit 3.
What
package.json:"@sveltejs/kit": "^2.12.0 || ^3.0.0"(still optional).hydration-server.ts: if the request state has SvelteKit 3'sis_in_remote_querybut no universal-load marker, the one-time warning explains that the handle has no effect there, what that means (universal loads re-run in the browser before auth), and the fix: moveconvexLoad()calls that need auth into+page.server.ts/+layout.server.ts(same code), remove the handle, plus a docs link. It's written so that a developer or an agent reading the console can apply it directly. Older SvelteKit 2 versions keep the existing message.How
convexLoadHydration.